import {
  Controller,
  Get,
  Post,
  Body,
  Patch,
  Param,
  Delete,
} from '@nestjs/common'
import { BudgetService } from './budget.service'

@Controller('budget')
export class BudgetController {
  constructor(private readonly budgetService: BudgetService) { }

  @Post('add')
  add(@Body() body) {
    return this.budgetService.add(body)
  }

  @Post('del')
  del(@Body() body) {
    return this.budgetService.del(body.id as number)
  }

  @Post('edit')
  edit(@Body() body) {
    return this.budgetService.update(body)
  }

  @Post('page')
  page(@Body() body) {
    return this.budgetService.getPageList(body)
  }

  @Post('getBudgetList')
  getBudgetList(@Body() body) {
    return this.budgetService.getBudgetList(body.isUse, body.orgId)
  }
}
